package com.star.bookstore.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * 书本的分类表
 * 
 * @author wuLiFei
 * @email wuLiFei.@gmail.com
 * @date 2021-03-07 11:04:13
 */
@Data
@TableName("pms_category")
public class CategoryEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 书本id
	 */
	@TableId
	private Long bookId;
	/**
	 * 书本名字
	 */
	@NotBlank(message = "分类名字不能为空")
	private String name;
	/**
	 * 书本父类id
	 */
	private Long parentId;
	/**
	 * 书本分类级别
	 */
	private Integer bookLevel;
	/**
	 * 逻辑删除状态（0已删除，1未删除）
	 */
	@TableLogic(value = "1",delval = "0")
	private Integer showStatus;
	/**
	 * 备选
	 */
	private String backup;
	/**
	 * 点赞，排序字段
	 */
	private Integer star;

	//子分类id
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	@TableField(exist = false)
	private List<CategoryEntity> children;


}
